package com.zyk.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zyk.mapper.ProductMapper;
import com.zyk.service.ProductService;

import entity.Product;
@Service
public class ProductServiceImpl implements ProductService {
	@Autowired
	private ProductMapper productMapper;
	
	@Override
	public boolean add(Product product) {
		return productMapper.addProduct(product);
	}

	@Override
	public Product get(Long id) {
		return productMapper.findById(id);
	}

	@Override
	public List<Product> list() {
		return productMapper.findAll();
	}

}
